Fix test for NULL command line in cmdline_parse()
authorDavid Vrabel <david.vrabel@citrix.com>
Fri, 23 Mar 2012 13:45:28 +0000 (13:45 +0000)
committerDavid Vrabel <david.vrabel@citrix.com>
Fri, 23 Mar 2012 13:45:28 +0000 (13:45 +0000)
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen/common/kernel.c

index 7141790a3e7fd808bcb9f8d42ce78320d0f043cf..91dc32eedf864e445c282261f887c2f32e82a896 100644 (file)
@@ -55,11 +55,11 @@ void __init cmdline_parse(const char *cmdline)
     struct kernel_param *param;
     int bool_assert;
 
-    safe_strcpy(saved_cmdline, cmdline);
-
-    if ( p == NULL )
+    if ( cmdline == NULL )
         return;
 
+    safe_strcpy(saved_cmdline, cmdline);
+
     for ( ; ; )
     {
         /* Skip whitespace. */